home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / t3_1 / sources.lha / sources / sys / zload.t < prev    next >
Text File  |  1988-02-05  |  5KB  |  144 lines

  1. (herald zload
  2.         (env tsys (osys kernel) (osys vm_port)))
  3.  
  4. ;;; Copyright (c) 1985 Yale University
  5. ;;;     Authors: N Adams, R Kelsey, D Kranz, J Philbin, J Rees.
  6. ;;; This material was developed by the T Project at the Yale University Computer 
  7. ;;; Science Department.  Permission to copy this software, to redistribute it, 
  8. ;;; and to use it for any purpose is granted, subject to the following restric-
  9. ;;; tions and understandings.
  10. ;;; 1. Any copy made of this software must include this copyright notice in full.
  11. ;;; 2. Users of this software agree to make their best efforts (a) to return
  12. ;;;    to the T Project at Yale any improvements or extensions that they make,
  13. ;;;    so that these may be included in future releases; and (b) to inform
  14. ;;;    the T Project of noteworthy uses of this software.
  15. ;;; 3. All materials developed as a consequence of the use of this software
  16. ;;;    shall duly acknowledge such use, in accordance with the usual standards
  17. ;;;    of acknowledging credit in academic research.
  18. ;;; 4. Yale has made no warrantee or representation that the operation of
  19. ;;;    this software will be error-free, and Yale is under no obligation to
  20. ;;;    provide any services, by way of maintenance, update, or otherwise.
  21. ;;; 5. In conjunction with products arising from the use of this material,
  22. ;;;    there shall be no use of the name of the Yale University nor of any
  23. ;;;    adaptation thereof in any advertising, promotional, or sales literature
  24. ;;;    without prior written consent from Yale in each case.
  25. ;;;
  26.  
  27. ;;; z-load.
  28.  
  29. (lset *z-print-load-message?* t)
  30.  
  31. (define (z-load path env)
  32.   (z-load-file path env nil))
  33.  
  34. (define (z-load-file path env bin?)
  35.   (if *z-print-load-message?* 
  36.       (z-format (standard-output) "~&~%;loading ~s~%" path))
  37.   (cond (bin?
  38.          (let ((path (if (symbol? path)
  39.                          (string-append (symbol->string path) ".MO")
  40.                          path)))
  41.            (with-open-ports ((port (open-port path 'in)))
  42.              (load-comex port env))))
  43.         (else
  44.          (let ((path (if (symbol? path)
  45.                          (string-append (symbol->string path) ".T")
  46.                          path)))
  47.            (with-open-ports ((port (open-port path 'in)))
  48.              (z-load-source port env))))))
  49.  
  50. (define (z-load-source port env)
  51.   (let ((firstfrob (let ((frob (z-read port)))
  52.                      (cond ((and (pair? frob)
  53.                                  (eq? (car frob) 'herald))
  54.                             (z-read port))
  55.                            (else frob)))))
  56.     (iterate loop ((frob firstfrob) (val nil))
  57.       (cond ((eof? frob) val)
  58.             (else
  59.              (let ((val (z-eval frob env)))
  60.                (loop (z-read port) val)))))))
  61.  
  62.  
  63. (comment ;this will replace the above
  64.   (define (z-load-file path env)
  65.     (with-open-ports ((port (open-port path 'in)))
  66.       (if *z-print-load-message?* 
  67.           (z-format (standard-output) "~&;loading ~s~%" path))
  68.       (let ((firstfrob (let ((frob (z-read port)))
  69.                          (cond ((and (pair? frob)
  70.                                      (eq? (car frob) 'herald))
  71.                                 (z-read port))
  72.                                (else frob)))))
  73.         (cond ((comex? firstfrob)
  74.                (receive (unit code) (install-comex firstfrob env)
  75.                  (set (weak-table-entry code-unit-table code) unit)
  76.                  (add-to-population code-population code)
  77.                  ;; run top-level forms
  78.                  ((unit-top-level-forms unit))))
  79.               (else
  80.                (iterate loop ((frob firstfrob) (val nil))
  81.                  (cond ((eof? frob) val)
  82.                        (else
  83.                         (let ((val (z-eval frob env)))
  84.                           (loop (z-read port) val))))))))))
  85. )
  86.  
  87. (define (z-load-system)
  88.   (z-load-file "~osys/syntax.mo" tvm-env t)
  89.   (walk (lambda (file) (z-load-file file tvm-env t))
  90.         '(ratio
  91.           aegis_float
  92.           arith
  93.           m68_bignum
  94.           bignum_fixnum
  95.           bignum_util
  96.           bignum
  97.           bignum_arith
  98.           dispatch
  99.           ;    pfloat
  100.           equality
  101.           ;(osys single_float)
  102.           ;(osys double-float)
  103.           ;(osys complex)
  104.  
  105.           ;; i/o system
  106.           port
  107.           aegis_port
  108.           sort
  109.           herald
  110.           load
  111.           infinite_vector
  112.           dump
  113.           dump_comex
  114.  
  115.           ;; Syntax system
  116.           macros       ; ENV calls MAKE-TABLE which calls GC_STAMP
  117.           aegis_macros ; macro's for foreign calls
  118.           cond
  119.           let
  120.           backquote
  121.           object       ; object macro
  122.           modify
  123.  
  124.  
  125.           ;; REPL
  126.           recognize
  127.           readtable
  128.           read
  129.           format
  130.           eval
  131.           repl
  132.           aegis
  133.           fs_parse
  134.           fs
  135.           tree
  136.           crawl
  137.           debug
  138.           trace
  139.           pp
  140.           exports
  141.           obsolete
  142.           tsystem
  143.           )))
  144.